<%@page language="java" pageEncoding="UTF-8"%>
<%@page import="com.qidian.common.Constants"%>
<%@page import="com.qidian.common.beans.ClientBean"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
ClientBean client= (ClientBean)request.getSession().getAttribute("client") ;
String skey = (String)request.getSession().getAttribute("key") ;
//System.out.println(basePath);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<base href="<%=basePath %>"></base>
    <title>答题客户端</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="accept-encoding" content="gzip,deflate">
	<meta http-equiv=”Cache-Control” content=”no-cache, must-revalidate” />
	<meta http-equiv=”expires” content=”Thu, 01 Jan 1970 00:00:01 GMT” />

	<!-- CSS -->
	<link href="style/css/transdmin.css" rel="stylesheet" type="text/css" media="screen" />
	<link rel="stylesheet" type="text/css" media="screen" href="style/css/ie6.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="style/css/ie7.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="style/css/jquery-ui.css" />
	
	<script type="text/javascript" src="style/js/jquery-1.8.2.min.js"></script>
	<script type="text/javascript" src="style/js/jNice.js"></script>
	<script type="text/javascript" src="style/js/mclient.js" charset="utf-8"></script>
	<!-- rechargeCard -->
	<script type="text/javascript">
	function init(){
		setKey('<%=skey%>');
		setPwd('<%=client.getPassword()%>');
		setClientId('<%=client.getClientId()%>');
	}
	
	maxLocalCacheSize = <%=Constants.max_msg_local%>;
	
	</script>
</head>

<body onload="init();">
	<div id="wrapper">
    	<!-- h1 tag stays for the logo, you can use the a tag for linking the index page -->
    	<h1><span>360远程代答</span></h1>
        
        <ul id="mainNav">
        	<li><a href="#" name="mainNavBar" class="active" onclick="return false;">客户端</a></li>
        	<li><a href="#" name="mainNavBar" onclick="return false;"><%=client.getClientName() %></a></li>
        	<li><a href="#" name="mainNavBar" onclick="return false;"><%=client.getName() %></a></li>
        	<li><a href="#" name="mainNavBar" onclick="return false;">日正确率:<span id=accuracyRate>100%</span></a></li>
        	<li><a href="#" name="mainNavBar">累积正确率:<span><%=((int)(client.getAcurateRatio()*10000))/100.0 %>%</span></a></li>
        	<li><a id=answerDescription href="#" name="mainNavBar" onclick="return false;">答案类型描述</a></li>
        	<li class="logout"><a href="#" name="mainNavBar" onclick="logout(); return false;">退出</a></li>
        	<input type="hidden" id="clientId" value="<%=client.getClientId() %>"></input>
        </ul>
        
        <div id="containerHolder">
			<div id="container">
        		<div id="sidebar">
                	<ul class="sideNav" align="center">
                    	<li><a>已答题数:&nbsp;&nbsp;<span id="answerCount">0</span></a></li>
                    	<li><a>答错题数:&nbsp;&nbsp;<span id="wrongCount">0</span></a></li>
                    	<li><a>累积点数:&nbsp;&nbsp;<span id="point">0</span></a></li>
                    	<li><a>服务器队列:&nbsp;&nbsp;<span id="waitCount">0</span></a></li>
                    	<li><a>本地队列:&nbsp;&nbsp;<span id="bufCount">0</span></a></li>
         				<li><input id="btnStartAnswer" type="button" value="开始答题" align="center" class="button ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all" onClick="startAnswer(); return false;"/></li>           	
         				<li><input id="btnStartWarning" type="button" value="来题报警" class="button ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all" onClick="startWarning(); return false;"/></li>
                    	<li><a>序号:&nbsp;&nbsp;<span id="msgId">0</span></a></li>
                    	<li><a>项目:&nbsp;&nbsp;<span id="gameType">0</span></a></li>
                    	<li><a>类型:&nbsp;&nbsp;<span id="answerType">0</span></a></li>
                    	<li><a>长度:&nbsp;&nbsp;<span id="answerLen">0</span></a></li>
                    	<li><a>倒计时:&nbsp;&nbsp;<span id="timeOut">0</span></a></li>
						<li><a>答案:&nbsp;&nbsp;</a></li>
                    </ul>
                    <p>&nbsp;&nbsp;&nbsp;&nbsp;<input  id="answer" type="text" maxlength=12 onkeyup="sendAnswerByKey(event,this); return false;" value=""/></p><br/>
                    <!-- <p>&nbsp;&nbsp;状态:&nbsp;&nbsp;<span id="errMsg">0</span></p>-->
                    <!-- // .sideNav -->
                </div>    
                <!-- // #sidebar -->
                
                <div id="main" class="main" name="contentDiv">
                  <h3>操作说明</h3>
                  	<p>1、按左侧&lt;开始答题&gt;按钮，开始答题</p><br/>
				    <p>2、按左侧&lt;暂停答题&gt;按钮，暂停答题</p><br/>
				    <p>3、按右上角&lt;退出&gt;按钮，结束答题</p><br/>
				    <p>4、按右上角&lt;错题查询&gt;按钮，查询错题记录、提交误报</p><br/>
				    <p>5、如果是非定长答案，请按回车发送答案</p><br/>
                </div>
                <div id="msgList" class="main x-hidden" name="contentDiv"></div>
                <div id="msgIdList" class="submain" name="contentDiv">取题队列:</div>
                <div id="answerList" class="submain" name="contentDiv">答案队列:</div>
                <div id="logger" class="submain" name="contentDiv">异常日志:</div>
                <div class="clear"></div>
                <div><embed id="snd" src="" loop="0" autostart="true" hidden=true></embed></div>
            </div>
            <!-- // #container -->
        </div>	

        <!-- // #containerHolder -->
        <p id="footer"><a href="#">360远程代答</a></p>
    </div>
    <!-- // #wrapper -->
</body>
</html>